package callback.wait.SyncCallback;

public class Server {
    public void response(Callback callback, String msg) throws InterruptedException {
        System.out.println("服务器获得请求：" + msg);
        //模拟消息处理，等待两秒钟
        Thread.sleep(2000);
        System.out.println("服务器端处理成功！ ");
        //处理完消息，调用回调方法，告知客户端
        callback.process(200);//200代表处理成功
    }
}

